Stop macOS startup from hanging on a stuck login shell - #5333
Open
Gabriel Dufresne (GabrielDuf) wants to merge 3 commits into
Open
Stop macOS startup from hanging on a stuck login shell#5333Gabriel Dufresne (GabrielDuf) wants to merge 3 commits into
Gabriel Dufresne (GabrielDuf) wants to merge 3 commits into
Conversation
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
August 28, 2026 20:18
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Improves macOS startup resilience by preventing stalled login shells from blocking the UI.
Changes:
- Moves macOS environment preparation off the UI thread.
- Adds timeout-based process output handling and process-tree termination.
- Adds cross-platform process-output tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/UniGetUI.Core.Tools/Tools.cs |
Adds timed process-output utility. |
src/UniGetUI.Core.Tools.Tests/ProcessOutputTests.cs |
Tests output, timeout, and launch failures. |
src/UniGetUI.Avalonia/Infrastructure/ProcessEnvironmentConfigurator.cs |
Applies timeout handling to macOS PATH expansion. |
src/UniGetUI.Avalonia/App.axaml.cs |
Makes macOS environment initialization asynchronous. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
August 28, 2026 20:29
View session
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
August 28, 2026 20:39
View session
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "de02ea50-a320-11f1-9e12-7427f864037c",
"headSha": "5e7791c247ad9aa987ef5609d858db034162da34",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the reliability and responsiveness of application startup on macOS by making the environment preparation asynchronous, adding robust timeout handling for login shell commands, and introducing a new utility method for safely reading process output. It also includes comprehensive tests for the new process output logic.
macOS startup improvements:
PrepareForCurrentPlatform) is now run asynchronously on macOS to prevent the UI from freezing if the login shell hangs or is slow. The main window is only created after this step completes, and the app respects quit requests during startup.PATHvariable on macOS now uses a timeout and improved error handling, ensuring that a stuck or slow shell does not block startup. Warnings are logged if thePATHcannot be read.Process output handling:
CoreTools.TryReadStandardOutputthat runs a command, waits for its output up to a given timeout, and kills the process tree if the timeout elapses. This prevents deadlocks when child processes hang.Testing:
ProcessOutputTeststo verify thatTryReadStandardOutputworks as expected, including handling of normal output, timeouts, and non-existent commands.Codebase organization: